import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;

public class ImageCreator 
{
    static public BufferedImage createImage(Image imageIn) 
    {
        return createImage(imageIn, BufferedImage.TYPE_INT_ARGB);
    }

    static public BufferedImage createImage(Image imageIn, int imageType) 
    {
        BufferedImage bufferedImageOut = new BufferedImage(imageIn.getWidth(null), imageIn.getHeight(null), imageType);
        Graphics g = bufferedImageOut.getGraphics();
        g.drawImage(imageIn, 0, 0, null);
        return bufferedImageOut;
    }
}
